﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Buffalo.Lib.Common;

namespace Buffalo.SMECommon.DAL
{
    public class General
    {
        public static string GenerateID()
        {
            try
            {
                string newID = Util.GenerateID().Replace("-", string.Empty);
                newID = newID.IndexOf("0") == 0 ? newID.Substring(1) : newID;
                if (Util.IsNumeric(newID.Substring(0, 1)))
                    newID = "f" + newID;
                if (newID.Length <= 15)
                    return GenerateID();
                newID = newID.Substring(0, 15);
                return newID;
            }
            catch (Exception)
            {                
                throw;
            }
        }
        public static DateTime GetCurrentDate()
        {
            return new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0);
        }

    }
}
